<button  onclick="diJian()">-</button>
<input id="i" value="1" style="width:60;"/>
<button  onclick="diJia()">+</button>
<script>
function diJian(){
  if(parseInt(i.value)>1){
    i.value = parseInt(i.value) - 1;
  }
}
function diJia(){
   if(parseInt(i.value)<666){
    i.value = parseInt(i.value) + 1;
  }

}
</script>